import request from '@/utils/request'

export default {

    getList() {
        return request({
            url: `/changgou-sys/sys/role/queryList`,
            method: 'get'
        })
    },

    insert(role) {
        return request({
            url: `/changgou-sys/sys/role/insert`,
            method: 'post',
            data: role
        })
    },
    update(role) {
        return request({
            url: `/changgou-sys/sys/role/update`,
            method: 'post',
            data: role
        })
    },
    delete(id) {
        return request({
            url: `/changgou-sys/sys/role/delete/${id}`,
            method: 'delete'
        })
    },

    insertRP(data) {
        return request({
            url: `/changgou-sys/sys/role/insertRP`,
            method: 'post',
            data: data
        })
    },
    getHasResourceByRole(roleId) {
        return request({
            url: `/changgou-sys/sys/role/queryHasResourceByRole/${roleId}`,
            method: 'get'
        })

    }

}
